package com.youlu.campus.admin.community.controller;

import com.youlu.campus.admin.annotation.RequestActivityAuth;
import com.youlu.campus.entity.MerchantSharingProfitInfo;
import com.youlu.campus.service.order.MerchantSharingProfitService;
import com.yuelin.infrastructure.quantum.common.QResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
public class MerchantSharingProfitController {

    @Autowired
    private MerchantSharingProfitService merchantSharingProfitService;

    @PutMapping("/activity/sharing-profit/{activityId}")
    public QResult saveSharingProfitConfig(@PathVariable String activityId,
                                           @RequestBody MerchantSharingProfitInfo merchantSharingProfitInfo) {
        merchantSharingProfitService.saveSharingProfitConfig(activityId, merchantSharingProfitInfo);
        return QResult.success(null);
    }

    @GetMapping("/activity/sharing-profit/info")
    public QResult getSharingProfitConfigByActivityId(String activityId) {
        return QResult.success(merchantSharingProfitService.getSharingProfitConfigByActivityId(activityId));
    }

}
